import { alltypeApi } from '../api'
// import * as TYPE from '../actionType/promoteType'

const state = {
	
	alltypelist: [],
	
}

const getters = {
	
	alltypelist: state => state.alltypelist,
	
}

const actions = {
	alltypelist({commit, state, rootState}) {
		rootState.requesting = true
		commit('ALLTYPE_LIST_REQUEST')
		alltypeApi.alltype().then((response) => {
			rootState.requesting = false
			commit('ALLTYPE_LIST_SUCCESS', response)
		}, (error) => {
			rootState.requesting = false
			commit('ALLTYPE_PROMOTE_LIST_FAILURE')
		})
	}
}

const mutations = {
	['ALLTYPE_LIST_REQUEST'] (state) {

	},
	['ALLTYPE_LIST_SUCCESS'] (state, response) {
		
		state.alltypelist = response.data
		
	},
	['ALLTYPE_LIST_FAILURE'] (state) {

	}
}

export default {
	state,
	getters,
	actions,
	mutations
}